<template>
	<div class="account">
		<div class="s">
			<div class="head">
				<span>个人中心</span>
				<div class="box"></div>
				<button class="btn1" @click="go">BACK</button>
				<div class="btn2">
					<button @click="logout">
						<Icon type="md-power" size="19"/>
					</button>
				</div>
			</div>
		</div>
		<div class="z">
			<div>
				<List>
					<ListItem>
						<ListItemMeta :avatar="headimg" :title="name" :description="text" />
					</ListItem>
				</List>
			</div>
			<div class="col">
					<Button type="primary">
						<span class="span">{{mony}}元</span>
						<br>
						我的余额
					</Button>
					<Button type="primary">
						<span class="span">{{red}}个</span>
						<br>
						我的红包
					</Button>
					<Button type="primary">
						<span class="span">{{this.integral}}分</span>
						<br>
						我的积分
					</Button>
			</div>
			<div class="lb">
				<List>
					<ListItem style="padding: 0px;">
						<template slot="extra">
							<button>
								<Icon type="ios-arrow-forward" size="20"/>
							</button>
						</template>
						<Icon class="tb" type="md-people" size="32"/>
						<ListItemMeta title="我的好友" class="ico"/>
					</ListItem>
				</List>
				<List>
					<ListItem style="padding: 0px">
						<template slot="extra">
							<button>
								<Icon type="ios-arrow-forward" size="20"/>
							</button>
						</template>
						<Icon class="tb" type="md-images" size="32"/>
						<ListItemMeta title="我的相册" class="ico"/>
					</ListItem>
				</List>
			</div>
			<div class="lb">
				<List>
					<ListItem style="padding: 0px">
						<template slot="extra">
							<button>
								<Icon type="ios-arrow-forward" size="20"/>
							</button>
						</template>
						<Icon class="tb" type="ios-paper" size="32"/>
						<ListItemMeta title="我的点评" class="ico"/>
					</ListItem>
				</List>
				<List>
					<ListItem style="padding: 0px">
						<template slot="extra">
							<button @click="colle">
								<Icon type="ios-arrow-forward" size="20"/>
							</button>
						</template>
						<Icon class="tb" type="md-heart"  size="32"/>
						<ListItemMeta title="我的收藏" class="ico"/>
					</ListItem>
				</List>
			</div>
			<div class="lb">
				<List>
					<ListItem style="padding: 0px">
						<template slot="extra">
							<button>
								<Icon type="ios-arrow-forward" size="20"/>
							</button>
						</template>
						<Icon class="tb" type="ios-home" size="32"/>
						<ListItemMeta title="积分商城" class="ico"/>
					</ListItem>
				</List>
				<List>
					<ListItem style="padding: 0px">
						<template slot="extra">
							<button>
								<Icon type="ios-arrow-forward" size="20"/>
							</button>
						</template>
						<Icon class="tb" type="md-cloud-outline" size="32"/>
						<ListItemMeta title="服务中心" class="ico"/>
					</ListItem>
				</List>
			</div>

		</div>
		<div class="li">
			<div class="xiang">
			</div>
		</div>
	</div>
</template>

<script>
	import axios from 'axios'
	export default {
		name: "Discount",
		data() {
			return {
				headimg: '',
				name:'',
				text: '',
				mony:'',
				red:'',
				integral:'',
			}
		},
		async mounted() {
			var users = JSON.parse(localStorage.users)
			console.log(users)
			// let data =await axios.post('/reception/assembly/user_info',{account:decode.account}).then(r=>r.data)
			this.name=users.name
			this.text=users.address
			this.headimg=require("../../../../php/public/static/img/"+users.headimg)
			this.integral=users.integral
			this.mony=users.balance
			this.red=users.count
		},
		methods: {
			logout(){
				return this.$router.push('/')
			},
			go() {
				return this.$router.push('/users/index')
			},
			colle(){
				return this.$router.push('/users/collection')
			},
		}
	}
</script>
<style lang="less">
	.account {
		max-width: 1024px;
		max-height: 1366px;
		margin: auto;

		.s {
			width: 100%;
			background-color: white;

			.headrs {
				width: 100%;
				height: 111px;
				background-repeat: no-repeat;
				background-size: 230px;
				background-position: 70%;
			}
		}

		.el {
			margin-left: 5%;
			width: 27%;
			text-align: center;
		}

		.ivu-dropdown-rel {
			margin-top: 10px;
			background-color: white;
			/*border-radius: 5px;*/
		}
		.ivu-list-item-meta-avatar{
			border: #9BB1C8 solid 5px;
			border-radius: 50%;
			width: 70px;
			height: 70px;
			text-align: center;
			margin-left: 10px;
			img{
				width: 60px;
				height: 70px;
			}
		}
		.ivu-avatar{
			width: 50px;
			height: 50px;
			border-radius: 50%;
			margin-top: 8%;
		}
		.ivu-btn-primary {
			height: 50px;
			background-color:white;
			border: white;
			color: #9BB1C8;
		}
		.z {
			width: 100%;
			height: 100px;
			.col{
				background-color: #9BB1C8;
				height: 70%;
				text-align: center;
				button{
					margin: 2.5%;
					width: 25%;
					font-size: 14px;
					.span{
						color: #FA4242;
					}
				}
			}
			.lb{
				position: relative;
				margin: 20px 0px;
				.ivu-list-item-meta-title{
					color: white;
				}
				.tb{
					margin: 0px 20px;
					color: white;
					background-color: #B0C1D3;
				}
				background-color: #B0C1D3;
				button{
					border:0px;
					background-color: #B0C1D3;
					margin-right: 15px;
					color: white;
				}
			}
		}

		.z > .head {
			padding: 0;
		}

		.head {
			height: 35px;
			color: white;
			width: 100%;
			background: #9BB1C8;
			font-size: 22px;
			text-align: center;
			padding-right: 10px;
			line-height: 1.5;
			position: relative;
		}

		.head > .btn2 {
			height: 25px;
			width: 25px;
			float: right;
			margin-top: 5px;
			text-align: center;
			padding-top: 3px;
			line-height: 0px;
			background-color: white;
			color: #9BB1C8;
			border-radius: 5px;
			button{
				border: 0;
				background-color:white ;
				color: #9BB1C8;
			}
		}

		.box {
			width: 0;
			height: 0;
			margin-top: 7px;
			float: left;
			border-top: 11px solid transparent;
			border-bottom: 11px solid transparent;
			border-left: 11px solid transparent;
			border-right: 11px solid white;
		}
		.clear {
			clear: both;
		}
		.btn1 {
			background: white;
			font-size: 10px;
			margin-top: 7px;
			margin-left: -1px;
			color: #9BB1C8;
			height: 22px;
			padding: 0px 5px;
			border: 1px aliceblue solid;
			border-radius: 10%;
			cursor: pointer;
			float: left;
		}
	}
</style>